package edu.pku.sei.modeler.editparts;

import org.eclipse.gef.EditPolicy;

import edu.pku.sei.modeler.edit.parts.DiagramEditPart;
import edu.pku.sei.modeler.editpolicies.UML2DiagramLayoutEditpolicy;
import edu.pku.sei.modeler.editpolicies.UMLDiagramLayoutEditPolicy;
import edu.pku.sei.modeler.model.structure.MetaDiagram;
import edu.pku.sei.modeler.uml.modelHelper.ModelPackage;

public class UMLDiagramEditpart extends DiagramEditPart {
	private String diagramType;
	
	public UMLDiagramEditpart(MetaDiagram model, String diagramType) {
		super(model);
		this.diagramType = diagramType;
	
	}
	
	@SuppressWarnings("deprecation")
	@Override
	protected void createEditPolicies() {
		super.createEditPolicies();

//		if (diagramType.equals(ModelPackage.DIAGRAM_UML_USECASE)
//				|| diagramType.equals(ModelPackage.DIAGRAM_UML_CLASS)
//				|| diagramType.equals(ModelPackage.DIAGRAM_UML_SEQUENCE)
//				|| diagramType.equals(ModelPackage.DIAGRAM_UML_COMPONENT)
//				|| diagramType.equals(ModelPackage.DIAGRAM_UML_STATEMACHINE)
//				|| diagramType.equals(ModelPackage.DIAGRAM_UML_ACTIVITY)
//				|| diagramType.equals(ModelPackage.DIAGRAM_UML_DEPLOYMENT)
//				|| diagramType.equals(ModelPackage.DIAGRAM_UML_COMPOSITESTRUCTURE)) {
//
//			installEditPolicy(EditPolicy.LAYOUT_ROLE,
//					new UML2DiagramLayoutEditpolicy(diagramType));
//		} else {
//			installEditPolicy(EditPolicy.LAYOUT_ROLE,
//					new UMLDiagramLayoutEditPolicy());
//		}
		installEditPolicy(EditPolicy.LAYOUT_ROLE, new UML2DiagramLayoutEditpolicy(diagramType));
	}

	
}
